package com.sinosoft.jwjw.component.service.imp.system;

import com.sinosoft.jwjw.base.BaseCrudMapper;
import com.sinosoft.jwjw.base.BaseCrudServiceImp;
import com.sinosoft.jwjw.component.mapper.system.SMenuMapper;
import com.sinosoft.jwjw.component.model.system.SMenu;
import com.sinosoft.jwjw.component.service.system.SMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 菜单管理service层
 * @ver 系统自动生成代码
 */
@Service
public class SMenuServiceImp extends BaseCrudServiceImp<SMenu,String> implements SMenuService  {

    @Autowired
    SMenuMapper sMenuMapper;

    @Override
    public BaseCrudMapper<SMenu, String> getMapper() {
        return sMenuMapper;
    }


    /**
     * 查询用户权限菜单    查询用户某个系统的-所有角色union all以后的菜单的权限
     * @param userId
     * @param systemId
     * @return
     */
    @Override
    public List<SMenu> selectAuthMenuBySystemIdAndUserId(String userId, String systemId) {
        Map<String, Object> params = new HashMap<>();
        params.put("userId",userId);
        params.put("systemId",systemId);
        return sMenuMapper.selectAuthMenuBySystemIdAndUserId(params);
    }
}
